﻿namespace WMS6.ServiceHost.WebService
{
    using System;
    using System.ComponentModel;
    using System.Web.Services;
    using System.Xml;
    using WMS6.Services;

    [ToolboxItem(false), WebService(Namespace="CEA.WebService"), WebServiceBinding(ConformsTo=WsiProfiles.BasicProfile1_1)]
    public class CEAWebServiceWMS : WebService
    {
        [WebMethod(Description="同步入库单数据")]
        public string DataSynchronizationASN(string strUserName, string strPassword, XmlDocument xdASN)
        {
            try
            {
                WMS6.Services.CEAWebServiceWMS Cea = new WMS6.Services.CEAWebServiceWMS(strUserName, strPassword);
                return Cea.DataSynchronizationASN(xdASN);
            }
            catch (Exception ex)
            {
                return ex.Message;
            }
        }

        [WebMethod(Description="同步客户数据")]
        public string DataSynchronizationCustomer(string strUserName, string strPassword, XmlDocument xdCustomer)
        {
            try
            {
                WMS6.Services.CEAWebServiceWMS Cea = new WMS6.Services.CEAWebServiceWMS(strUserName, strPassword);
                return Cea.DataSynchronizationCustomer(xdCustomer);
            }
            catch (Exception ex)
            {
                return ex.Message;
            }
        }

        [WebMethod(Description="同步发货订单数据")]
        public string DataSynchronizationOrders(string strUserName, string strPassword, XmlDocument xdOrders)
        {
            try
            {
                WMS6.Services.CEAWebServiceWMS Cea = new WMS6.Services.CEAWebServiceWMS(strUserName, strPassword);
                return Cea.DataSynchronizationOrders(xdOrders);
            }
            catch (Exception ex)
            {
                return ex.Message;
            }
        }

        [WebMethod(Description="同步销售数据")]
        public string DataSynchronizationSales(string strUserName, string strPassword, XmlDocument xdSales)
        {
            try
            {
                WMS6.Services.CEAWebServiceWMS Cea = new WMS6.Services.CEAWebServiceWMS(strUserName, strPassword);
                return Cea.DataSynchronizationSales(xdSales);
            }
            catch (Exception ex)
            {
                return ex.Message;
            }
        }

        [WebMethod(Description="同步货品数据")]
        public string DataSynchronizationSku(string strUserName, string strPassword, XmlDocument xdSku)
        {
            try
            {
                WMS6.Services.CEAWebServiceWMS Cea = new WMS6.Services.CEAWebServiceWMS(strUserName, strPassword);
                return Cea.DataSynchronizationSku(xdSku);
            }
            catch (Exception ex)
            {
                return ex.Message;
            }
        }

        [WebMethod(Description="同步供应商数据")]
        public string DataSynchronizationVendor(string strUserName, string strPassword, XmlDocument xdVendor)
        {
            try
            {
                WMS6.Services.CEAWebServiceWMS Cea = new WMS6.Services.CEAWebServiceWMS(strUserName, strPassword);
                return Cea.DataSynchronizationVendor(xdVendor);
            }
            catch (Exception ex)
            {
                return ex.Message;
            }
        }
    }
}

